

#ifndef DEFINES_SLIPMODEL_H_
#define DEFINES_SLIPMODEL_H_


// define structure for slipmodel
struct slipmodel{
    char filename[512];
    double **segmentData;     // (numberSegments x 10) matrix
    double **patchData;       // (numberPatches x 5) matrix
    int numberSegments;       // number of segments
    int *numberPatches;       // vector giving the number of patches for every segment
    int numberPatchesTotal;   // total number of patches of slip model
    int **indicesPatches;     // patch data for all segments is stored in one matrix, indicesPatches gives the start and end index
    int numberObsLat;         // data for observational array (used for coulomb calculation)
    double obsLatMin;
    double obsLatMax;
    int numberObsLon;
    double obsLonMin;
    double obsLonMax;
    double friction;          // values only used for Coulomb calculations
    double skempton;
    double strike;
    double dip;
    double rake;
    double sigma1;
    double sigma2;
    double sigma3;
    char cmbOutFolder[512];
    char cmbOutFile[512];
    char grnFolder[512];
};

int slipmodelRead(struct slipmodel *pscmp);
int slipmodelWrite(struct slipmodel pscmp);
int slipmodelCopy(struct slipmodel original, struct slipmodel *copy);
int slipmodelFree(struct slipmodel *model);
int slipmodelRandomslip(struct slipmodel *model, long seedIn, double Me, double k_exponent, int usetaper);
int randslip(double *slip, long *seed, double oxdim, double oydim, double discx, double discy, double *coords_x, double *coords_y,
        int no_patches_x, int no_patches_y, double Me, double k_exponent, int usetaper);

#endif /* DEFINES_SLIPMODEL_H_ */
